<?php  
//connection information
include("funciones/setup.php");
conecta();
	$query = "SELECT * FROM proveedor WHERE nombre_pro LIKE '%$queryString%' OR rut_pro LIKE '%$queryString%'  LIMIT 10";
	$resultado=mysql_query($query);
        if($resultado) {
            // While there are results loop through them - fetching an Object (i like PHP5 btw!).
            while ($result = mysql_fetch_array($resultado)) {
                // Format the results, im using
	
                // The onClick function fills the textbox with the result.
                ?>
	              <li onclick="fill(<?php echo $result['id_pro'];?>,'<?php echo $result['nombre_pro']; ?>')"><?php echo $result['nombre_pro']; ?></li>
				<?php
            }
		}
			/*
	//query the database
    $param = $_GET["term"];  
  
    ///query the database  
	$sql="SELECT * FROM proveedor WHERE nombre_pro REGEXP  '^$param'";
    $query = mysql_query($sql);  
  
    //build array of results  
    for ($x = 0, $numrows = mysql_num_rows($query); $x < $numrows; $x++) {  
        $row = mysql_fetch_assoc($query);  
  
        $friends[$x] = array("name" => $row["name"]);  
    }  
  
    //echo JSON to page  
    $response = $_GET["callback"] . "(" . json_encode($friends) . ")";  
    echo $response;  
	mysql_close($server);
  */
?>  